package HomeWork2;


import java.util.Scanner;

public class D0323 {
    public static void main(String[] args) {
        int b = 0;
        int c = 0;
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入一个数字字符串：");
        String str = scanner.next();
        //使用平台的默认字符集将此String编码为字节序列，结果存到新的字节数组中
        byte[] a = str.getBytes();
        for (int i = 0; i < a.length; i++) {
            if (a[i] % 2 == 0) {
                b++;
            } else {
                c++;
            }
        }
        System.out.println("偶数个数："+b);
        System.out.println("奇数个数："+c);
    }
}
